#pragma once
#include "Sprite.h"
#include "Damage.h"
#include <vector>
#include "Ammo.h"
#include "Range.h"
#include "IWaveInteractor.h"
#include "IClickable.h"

class Wave;

class TowerBase : public Sprite , public IWaveInteractor , public IClickable
{
	
	Range range;

	int shootRate;
	int count;

	int ammoSpeed;

public:

	TowerBase(void);
	virtual ~TowerBase(void);

	virtual void waveInteract(Wave * wave);
	virtual void init();
	virtual void destroy();

	void setDamageValue(double dmgValue);
	double getDamageValue();
	void setRangeValue(double val);
	double getRangeValue();

	bool isRangeVisible();

	void setAmmoSpeed(int ammoSpeed);
	int getAmmoSpeed();
	virtual void draw(SDL_Renderer * renderer);

	void showRange(bool val);

	void shoot(EnemyBase * enemy);
	void setShootRate(int rate);
	int getShootRate();

	SDL_Rect getInteractionArea();
	virtual void onClick();

	virtual TowerBase * copy();

protected:

	virtual Ammo * createAmmo();
	virtual void onAreaChange();

	Damage ammoDamage;
};

